#include <iostream>

using namespace std;

void print_a(const int* a, int len) {
    // cout << "作为参数接受后，数组大小: " << sizeof(a) << endl;

    for(int i = 0; i < len; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
}


void sort(int* a, int len) {
    for(int i = len-1; i > 0; i--) {
        for(int j = 0; j < i; j++) {
            if(a[j] > a[j+1]) {
                int tp = a[j];
                a[j] = a[j+1];
                a[j+1] = tp;
            }
        }
    }
}

int main()
{
    // 对数组经行 升序排序
    int a[] = {1, -2, 3, -4, 5, -6, 7, -8, 9, -10};
    int len = sizeof(a) / sizeof(a[0]);

//     cout << "数组作为参数传递前大小为: " << sizeof(a) << endl;

    
    print_a(a, len);
    sort(a, len);
    print_a(a, len);

    return 0;
}

